projects
/
project
/
bcm63xx
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b7d3e4a
)
mtd: pxa3xx_nand: Correct offset calculation
author
Kevin Smith
<
[email protected]
>
Thu, 14 Jan 2016 16:01:38 +0000
(16:01 +0000)
committer
Scott Wood
<
[email protected]
>
Fri, 12 Feb 2016 23:13:47 +0000
(17:13 -0600)
Correct some pointer math in initialization. An offset was added
to a struct-typed pointer instead of one casted to a byte-size,
resulting in a much larger offset than intended.
Signed-off-by: Kevin Smith <
[email protected]
>
Cc: Stefan Roese <
[email protected]
>
Cc: Luka Perkov <
[email protected]
>
Cc: Scott Wood <
[email protected]
>
drivers/mtd/nand/pxa3xx_nand.c
patch
|
blob
|
history
diff --git
a/drivers/mtd/nand/pxa3xx_nand.c
b/drivers/mtd/nand/pxa3xx_nand.c
index 9202459b0f9dfd03754ed77732c55a4888e2bca3..a83f6c2eff03063d4790aa413cd02fc12d8ce1d6 100644
(file)
--- a/
drivers/mtd/nand/pxa3xx_nand.c
+++ b/
drivers/mtd/nand/pxa3xx_nand.c
@@
-1486,8
+1486,8
@@
static int alloc_nand_resource(struct pxa3xx_nand_info *info)
info->variant = pxa3xx_nand_get_variant();
for (cs = 0; cs < pdata->num_cs; cs++) {
mtd = &nand_info[cs];
- chip = (struct nand_chip *)
info +
-
sizeof(struct pxa3xx_nand_host
);
+ chip = (struct nand_chip *)
+
((u8 *)&info[1] + sizeof(*host) * cs
);
host = (struct pxa3xx_nand_host *)chip;
info->host[cs] = host;
host->mtd = mtd;